package com.pet.mapper;

import com.pet.entity.Employee;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface EmployeeMapper {

    /**
     * 根据用户名查询员工
     * @param username
     * @return
     */
    @Select("select * from employee where username = #{username}")
    Employee getByUsername(String username);

    /**
     * 根据id查询员工信息
     * @param currentId
     * @return
     */
    @Select("select * from employee where id = #{currentId}")
    Employee getAdminInfo(Long currentId);

    /**
     * 更新员工信息
     * @param employee
     */
    void updateAdminInfo(Employee employee);

    /**
     * 插入员工数据
     * @param employee
     */
//    @Insert("insert into employee " +
//            "(name, username, password, phone," +
//            " sex, id_number, status, create_time, update_time, create_user, update_user) " +
//            "VALUES " +
//            "(#{name},#{username},#{password},#{phone}," +
//            "#{sex},#{idNumber},#{status},#{createTime},#{updateTime},#{createUser},#{updateUser})")
//    @AutoFill(value = OperationType.INSERT)
//    void insert(Employee employee);
//
//    /**
//     * 分页查询
//     * @param employeePageQueryDTO
//     * @return
//     */
//    Page<Employee> pageQuery(EmployeePageQueryDTO employeePageQueryDTO);
//
//    /**
//     * 更新操作
//     * @param employee
//     */
//    @AutoFill(value = OperationType.UPDATE)//该注解用于公共字段内容的输入，简化操作
//    void update(Employee employee);
//
//    /**
//     * 通过id进行查询
//     * @param id
//     * @return
//     */
//    @Select("select * from employee where id = #{id}")
//    Employee getById(Long id);
}
